import request from "../../utils/request.js";

/**
 * 查询脚本列表
 * @returns 
 */
export const getScriptList_Api = (query) => request.get("/automated/scriptManage/list", {
    params: query
})

/**
 * 新增脚本
 * @returns 
 */
export const addScript_Api = (data) => request.post("/automated/scriptManage", data)


/**
 * 删除脚本
 * @returns 
 */
export const delScript_Api = (id) => request.delete("/automated/scriptManage/" + id)

/**
 * 编辑脚本
 * @returns 
 */
export const editScript_Api = (data) => request.put("/automated/scriptManage", data)



///脚本执行页面
/**
 * 查询脚本任务列表
 * @param {*} query  //分页
 * @returns 
 */
export const getScriptTaskList_Api = (query) => request.get("/automated/scriptTask/list", {
    params: query
})


/**
 * 新增脚本任务
 * @param {*} data 
 * @returns 
 */
export const addScriptTask_Api = (data) => request.post("/automated/scriptTask", data)


/**
 * 编辑脚本
 * @returns 
 */
export const editScriptTask_Api = (data) => request.put("/automated/scriptTask", data)

/**
 * 删除脚本
 * @returns 
 */
export const delScriptTask_Api = (id) => request.delete("/automated/scriptTask/" + id)

/**
 * 查询脚本任务详情
 * @param {*} query  //分页
 * @returns 
 */
export const getScriptTaskDetail_Api = (id) => request.get("/automated/scriptTask/" + id)



/**
 * 再次执行脚本
 * @param {*} data 
 * @returns 
 */
export const executeAgain_Api = (data) => request.post("/automated/scriptTask/executeAgain", data)


/**
 * 历史记录列表
 * @param {*} query  //分页
 * @returns 
 */
export const getHistoryList_Api = (query) => request.get("/automated/scriptTask/historyList", {
    params: query
})